<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="css/base.css" rel="stylesheet" type="text/css" />
<link href="css/news.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery-1.12.0.min.js"></script>
<title>新闻</title>
<script>
//    $(function(){
//        $(".pro_left ul a li").click(function(){
//            $(this).addClass("xuan");
//        });
//    });

$(function(){
    $(".pro_left ul li").click(function(){
        Mycookie(this.id)
    });
    var cookie=$.cookie("cookie"); //读取cookie
    if(cookie){
        Mycookie(cookie);
    }
})
function Mycookie(thiscookie){
    $("#"+thiscookie).addClass("xuan").siblings().removeClass("xuan");
    $.cookie("cookie",thiscookie)
}

</script>
</head>

<body>
<div class="container">
<!--  top-->
<div  class="top">
  <p></p>
  <div class="logo">
        <div class="right">
         <ul>
             <li><span><a href="#"><img src="img/top_06.png" width="35" height="31" /></a></span></li>
              <li>分享主页</li>
              <li><span><a href="#"><img src="img/top_08.png" width="37" height="31" /></a></span></li>
              <li><span><a href="#"><img src="img/top_09.png" width="35" height="31" /></a></span></li>
              <li><span><a href="#"><img src="img/top_10.png" width="36" height="31" /></a></span></li>
              <li><span><img src="img/top_14.png" width="35" height="28" /></span></li>
              <li>客服中心</li>
              <li>&nbsp;02038812035</li>
          </ul>
      </div>
  </div>
</div>
<!--  nav-->
    <div class="nav">
          <div class="nav_weizhi">
              <ul>
                  <a href="index.php">  <li >首&nbsp;&nbsp;页</li></a>
                  <a href="news.php?fl=公司新闻">  <li class="xianshi">新闻动态</li></a>
                  <a href="service.php?sv=服务承诺">  <li>服务支持</li></a>
                  <a href="products_and_solution.php?fl=后背式">  <li>森特产品与方案</li></a>
                  <a href="buy.php?buy=渠道代理">  <li>如何购买</li></a>
                  <a href="about_us.php?fl=公司简介">  <li>关于森特</li></a>
                  <a href="recruit.php?cls=招聘动态">  <li>招贤纳士</li></a>
              </ul>
          </div>
    </div>
   
  <div class="quanbu"> 
    <div class="news">
   <img src='img/news_01.jpg' width="34" height="29" />新闻/News
   <p>
<img src='img/news_09.jpg' width="990" height="1" />
   </p>
</div>


<div class="dleft_side_bar">
  <div class= "pro_left">
    	<ul>
    		<a href="news.php?fl=公司新闻"><li class="<?php $fl=!empty($_GET['fl'])?$_GET['fl']:null;if($fl=='公司新闻'){echo 'xuan';}?>">公司新闻</li></a>
          	<a href="news.php?fl=行业动态"><li class="<?php $fl=!empty($_GET['fl'])?$_GET['fl']:null;if($fl=='行业动态'){echo 'xuan';}?>">行业动态</li></a>
            <a href="news.php?fl=人物专访"><li class="<?php $fl=!empty($_GET['fl'])?$_GET['fl']:null;if($fl=='人物专访'){echo 'xuan';}?>">人物专访</li></a>
            <a href="news.php?fl=名家专栏"><li class="<?php $fl=!empty($_GET['fl'])?$_GET['fl']:null;if($fl=='名家专栏'){echo 'xuan';}?>">名家专栏</li></a>
            <a href="news.php?fl=防伪认证"><li class="<?php $fl=!empty($_GET['fl'])?$_GET['fl']:null;if($fl=='防伪认证'){echo 'xuan';}?>">防伪认证</li></a>
            <a href="news.php?fl=通知公告"><li class="<?php $fl=!empty($_GET['fl'])?$_GET['fl']:null;if($fl=='通知公告'){echo 'xuan';}?>">通知公告</li></a>
        </ul>
    </div>
    <div class="right_right">
    <?php

        $page=!empty($_GET['p'])?$_GET['p']:1;

        include "config.php";
        $sql="select * from news where class = '公司新闻' limit ".($page-1)*10 .",8";

        if(!empty($_GET['fl'])){
            $fl=$_GET['fl'];
            $sql="select * from news where class = '{$fl}' limit ".($page-1)*10 .",8";
//            $sql="select * from news where class = '{$fl}'";
        }
        $ret=$mysqli->query($sql);
        while($rows=$ret->fetch_array()){
    ?>

        <div class="right1">
            <img src="img/news_03.jpg" width="90" height="90"/>
        </div>
        <div class="right2">
            <div class="date">
                <div class="date1">
                    <p style=" font-size:30px;"><?php echo date('j',strtotime($rows['time']));?><nobr style=" color:red;">|</nobr>
                </div>
                </p>&nbsp;<?php echo date('n',strtotime($rows['time']));?>月<br>&nbsp;<?php echo date('Y',strtotime($rows['time']));?>
            </div>
            &nbsp;&nbsp;&nbsp;<a href="news_details.php?id=<?php echo $rows['id'];?>"> 【<?php echo $rows['class'];?>】 <B><?php echo $rows['title'];?></B></a>
            <p>&nbsp;</p>
            <p class="wz"><a href="news_details.php?id=<?php echo $rows['id'];?>">
                    <?php echo "&nbsp;&nbsp;&nbsp;&nbsp;".mb_substr(trim(strip_tags($rows['content'])),0,89,'utf-8');?> . . .</a>
            </p>
        </div>
        <img src='img/news_04.jpg' width="744" height="9"/>
        <?php
        }

        $sql="select * from news where class ='公司新闻'";
        if(!empty($_GET['fl'])){
            $sql="select * from news where class ='{$fl}'";

        }
        $ret=$mysqli->query($sql);
        $max=ceil(mysqli_num_rows($ret)/8);
    ?>


    
        <?php
        if($ret->num_rows>0) {
            ?>
            <div class="pro_rightfot">
                <a href="news.php?p=<?php echo $page - 1 <= 0 ? 1 : $page - 1; ?>"><img src="img/7.png"/></a>
            <span>
                <?php
                $showPage = 5;
                $pageoffset = floor(($showPage - 1) / 2);
                $start = 1;
                $end = $max;
                if ($max > $showPage) {
                    if ($page > $pageoffset + 1) {
                        echo "&nbsp;&nbsp;&nbsp;…";
                    }
                    if ($page > $pageoffset) {
                        $start = $page - $pageoffset;
                        $end = $max > $page + $pageoffset ? $page + $pageoffset : $max;
                    } else {
                        $start = 1;
                        $end = $max > $showPage ? $showPage : $max;
                    }
                    if ($page + $pageoffset > $max) {
                        $start = $start - ($page + $pageoffset - $end);
                    }
                }
                ?>
                &nbsp;
                <?php
                for ($i = $start; $i <=$end; $i++) {

                    ?>
                    &nbsp;
                    <a href="news.php?p=<?php echo $i; ?>" <?php $tp=!empty($_GET['p'])?$_GET['p']:1; if ($tp == $i) {
                        echo "style='color: red'";
                    } ?>><?php echo $i; ?> </a>
                    <?php
                }
                ?>
                &nbsp;&nbsp;
            </span>
                <a href="news.php?p=<?php echo $page > $max ? $max : $page + 1; ?>"><img src="img/8.png"/></a>
                </span>
            </div>
            <?php
        }
        ?>
  

  
 

 </div>
</div>
</div>


   
<!--  footer-->
 <div class="footers">
   
    <div class="footer">
         <div class="a footer_1">
          <h4>森特电子有限公司</h4>
            <ul class="aa">
                <li>电话</li>
                 <li>020&nbsp;38812035</li>
                  <li>传真</li>
                   <li>020&nbsp;38812035</li>
                    <li>TEL00</li>
                     <li>186	76289867</li>
                      <li>地址</li>
                       <li>广州市天河路365号&nbsp;天俊阁1202</li>
                       
            </ul>
        
        </div>
         <div class="a footer_2">
            <h4>新闻动态</h4>
         
              <ul class="aa">
                  <li><a href="#">公司新闻</a></li>
                  <li><a href="#">行业动态</a></li>
                  <li><a href="#">人物专访</a></li>
                  <li><a href="#">名家专访</a></li>
                  <li><a href="#">防伪认证</a></li>
                  <li><a href="#">通知公告</a></li>
              </ul>
        </div>
         <div class="a footer_3">
           <h4>服务支持</h4>
         
                <ul class="aa">
                  <li><a href="#">服务承诺</a></li>
                  <li><a href="#">服务网点</a></li>
                  <li><a href="#">服务产品</a></li>
                  <li><a href="#">下载中心</a></li>
              
              </ul>
        </div>
         <div class="a footer_4">
           <h4>森特产品与方案</h4>
             <ul class="aa">
                     <li><a href="#">后备式</a></li>
                     <li><a href="#">在线式Castle系列</a></li>
                     <li><a href="#">监控产品</a></li>
                      <li><a href="#">促销</a></li>
                     <li><a href="#">    模块化ARRAY系列</a></li>
                     <li><a href="#">   配电产品</a></li>
                     <li><a href="#">城堡系列电池</a></li>
                      <li><a href="#">   方案应用</a></li>
              </ul>
          </div>
         <div class="a footer_5">
            <h4>如何购买</h4>
                <ul class="aa">
                          <li><a href="#">渠道代理</a></li>
                          <li><a href="#">如何选购</a></li>
                          <li><a href="#">常见问题</a></li>
        
                  </ul>
          </div>
         <div class="a footer_6">
           <h4>关于森特</h4>
         
             <ul class="aa">
                  <li><a href="#">公司简介</a></li>
                  <li><a href="#">企业理念</a></li>
                  <li><a href="#">公司地址</a></li>
                  <li><a href="#">分支机构</a></li>
               <li><a href="#">我们的荣誉</a></li>
       
              </ul>
           </div>
         <div class="a footer_7">
           <h4>招纳贤士</h4>
             <ul class="aa">
                    <li><a href="#">招聘动态</a></li>
                    <li><a href="#">高校招聘</a></li>
                   <li><a href="#">社会招聘</a></li>
           
              </ul>
        </div>
        
     
    </div>
    
<div class="tupian"><a href="#"><img src="img/footer_1.png" width="55" height="54" /></a>
    </div>
     <div class="footer_8"> 
  <p>森特电子科技有限公司版权所有©2004-2015 侵权必究 粤ICP备11021230号<a href="Admin/index.php" style="color: red"> 后台管理</a> </p>
        </div> 
   </div>
</div>

</body>
</html>
